import { getToken } from "../utils/token"
import { Navigate } from "react-router-dom" 
const AuthRoot = ({ children }) => {
  if (getToken()) {
    return <>{children}</>
  } else {
    return <Navigate to="/login" replace />
  }
}
export default AuthRoot